<?php
namespace app\common\validate;

use think\Validate;

class ScreenSaverValidate extends Validate
{
    protected $rule =   [
        'title'  => 'require|max:50',
        'content' => 'require',
        'images' => 'require',
		'sort'	=> 'require|number'
    ];
    
    protected $message  =   [
        'title.require' => '标题必须填写',
        'title.max'     => '标题最多不能超过50个字符',
		'content.require'=> '内容必须填写',
		'images.require'=> '图集必须填写',
		'sort.number' => '必须输入数字',
    ];
    
    protected $scene = [
        'add'  =>  ['title','content','sort'],
        'addVideo'  =>  ['title','images','sort'],
        'edit'  => ['title','content','sort'],
        'editVideo'  => ['title','images','sort'],
		'sort' => ['sort']
    ];
}
